import { Controller, Post } from '@nestjs/common';
import { QueueService } from './queue.service';
import bull from 'bull';
import { InjectQueue } from '@nestjs/bull';

@Controller('queue')
export class QueueController {
  constructor(
    private readonly queueService: QueueService,
    @InjectQueue('queue') private readonly audioQueue: bull.Queue,
  ) {}

  @Post('transcode')
  async transcode() {
    await this.audioQueue.add('transcode', {
      file: 'audio.mp3',
    });
  }
}
